var fileWindow = document.getElementsByClassName("file-window")[0];
var fileDragPanel= document.getElementsByClassName("file-draw-panel")[0];

fileWindow.ondragenter = function (e) {
    e.preventDefault();
    showPanel(true)
}

fileDragPanel.ondragleave = function (e) {
    e.preventDefault();
    showPanel(false)
}

fileWindow.ondragover = function (e) {
    e.preventDefault();
}

fileWindow.ondrop = function (e) {
    showPanel(false)
    e.preventDefault();
    e.stopPropagation();
    [].forEach.call(e.dataTransfer.files, function (file) {
        uploadItemFile(file)
    }, false);

}


function showPanel(flag) {
    $(".file-draw-panel").css("display", flag ? "flex" : "none")
}
